package com.admin.model.dto;

import com.admin.model.base.BaseDto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.util.List;

/**
 * (Role)实体类
 *
 * @author makejava
 * @since 2021-01-31 19:58:51
 */
@ApiModel("角色实体类")
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class RoleDto extends BaseDto implements Serializable {
    private static final long serialVersionUID = -51266979279654066L;
    /**
    * id
    */
    @NotNull(message = "id不能为空",groups = Update.class)
    @Null(message = "id必须为空",groups = Create.class)
    @ApiModelProperty("id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    /**
    * 名称
    */
    @NotBlank(message = "角色名称不能为空",groups = Create.class)
    @ApiModelProperty("角色名称")
    private String name;
    /**
    * 角色级别
    */
    @NotNull(message = "角色级别不能为空",groups = Create.class)
    @ApiModelProperty("角色级别")
    private Integer level;
    /**
    * 数据权限
    */
    @ApiModelProperty("数据权限")
    private Integer dataScope;
    /**
    * 描述
    */
    @ApiModelProperty("描述")
    private String description;

    /**
     * 角色权限菜单
     */
    @ApiModelProperty("角色权限菜单")
    private List<MenuDto> menus;

}